package com.zz.ecommerce.common.xml.util;

import com.zz.ecommerce.common.CommonDao;
import com.zz.ecommerce.common.bean.TMessage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * Created by Administrator on 2015-12-19.
 */
@Repository
public interface XmlDao extends CommonDao<TMessage> {
    @Select("select LOCAL_PATH from BUSI_PARAM.XML_TRANS_INFO where TRANS_ID=#{transId}")
    String getLocalPath(@Param("transId") String transId);

    @Insert("INSERT INTO T_MESSAGE(MESSAGE_ID, XML, TYPE) VALUES(#{messageId}, #{xml}, #{type})")
    int logXml(@Param("messageId") String messageId,
               @Param("xml") String xml,
               @Param("type") String type);

    @Insert("INSERT INTO ECOMMERCE.T_MESSAGE(MESSAGE_ID, RELATE_MESSAGE_ID, XML, TYPE) VALUES(#{messageId}, #{relateMessageId}, #{xml}, #{type})")
    int logRelateXml(@Param("messageId") String messageId,
                     @Param("relateMessageId") String relateMessageId,
                     @Param("xml") String xml,
                     @Param("type") String type);

}
